var fn = (imgList, progressCb, completeCb) => {

  const MaxNum = imgList.length - 1;
  var curNum = 0;

  for (let i = 0; i < imgList.length; i++) {
    var img = imgList[i];
    var idom = new Image();
    idom.src = img;
    idom.onload = function () {
      curNum++;

      var percent = (curNum / MaxNum);
      progressCb(parseInt(percent.toFixed(2) * 100));

      if (curNum >= MaxNum) {
        completeCb();
      }

    }
  }
}

export default fn;